package src;

import java.net.URL;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.FillLayout;

public class Help extends Shell
{

	/**
	 * Launch the application.
	 * 
	 * @param args
	 */
	public static void show()
	{
		try
		{
			Display display = Display.getDefault();
			Help shell = new Help(display);
			shell.open();
			shell.layout();
			while (!shell.isDisposed())
			{
				if (!display.readAndDispatch())
				{
					display.sleep();
				}
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}

	/**
	 * Create the shell.
	 * 
	 * @param display
	 */
	public Help(Display display)
	{
		super(display, SWT.SHELL_TRIM);
		setImage(org.eclipse.wb.swt.SWTResourceManager.getImage(Help.class, "/src/icon/world.ico"));
		setLayout(new FillLayout(SWT.HORIZONTAL));

		Browser browser = new Browser(this, SWT.NONE);
		URL url = this.getClass().getResource("/html/Help.htm");
		browser.setUrl(url.toString());
		createContents();
	}

	/**
	 * Create contents of the shell.
	 */
	protected void createContents()
	{
		setText("SWT Application");
		setSize(800, 550);

	}

	@Override
	protected void checkSubclass()
	{
		// Disable the check that prevents subclassing of SWT components
	}

}
